(function ($, window, document) {

	function TheDialog (el) {
		this.el = el;
		this.init();
	}
	var prototype = {
		init: function () {
			this.dom = $(this.el);
			this.initEvent();
		},
		initEvent: function () {
			var _this = this;

			// 点击关闭按钮
			this.dom.find('.close-btn').on('click', function () {
				_this.close();
			})
		},
		show: function () {
			var _this = this;
			this.dom.css({
				display: 'block'
			})
			setTimeout(function () {
				_this.dom.addClass('is-show');
			}, 10);
		},
		close: function () {
			var _this = this;
			this.dom.removeClass('is-show');
			setTimeout(function () {
				_this.dom.css({
					display: 'none'
				});
			}, 300);
		},
		remove: function () {
			var _this = this;
			this.dom.removeClass('is-show');
			setTimeout(function () {
				_this.dom.remove();
			}, 300);
		}
	}
	for (var i in prototype) {
		TheDialog.prototype[i] = prototype[i];
	}
	window.TheDialog = TheDialog;

})(jQuery, window, document);